void Navier::CompGV1(int i, int j, int k, int gama)//calculate temporary V velocity
{
              //cout<<"\n ****************** Entrei na CompFV1 ******************************** \n";
              //cout<<"\n *****************************"<<i<<","<< j<<","<<k<<"***********************\n";
	      int alpha,beta;
	      double e0,e1,e2,c1,c2,d1,d2;
	      double coef0,coef1,coef2;
              double d2vdx2, d2vdy2, d2vdz2;
              double Gy;
              Gy = S.g[0]/S.froude;
              S.nu = 0.0;
	      alpha = 2*gama -1;
	      beta = alpha + gama;

	      coef0 = alpha*V[i][j+gama][k];
	      if(coef0>=0);
              {
		  coef0 *=(-1.0/DY[j]);
		  e0= V[i][j+1-gama][k];
                  coef1 = U[i+1][j][k]+U[i][j][k];
		  coef2 = W[i][j][k+1]+W[i][j][k];
	      }
	     else
	     {
		  coef0 *=(1.0/DY[j+alpha]);
	  	  if((j<S.gridp[1] || (alpha == -1)) 
		  {
		      e0 =.25*(gridVertexUVW.gridV(i,j+beta,k)+gridVertexUVW.gridV(i+1,j+beta,k) + 
			    gridVertexUVW.gridV(i,j+beta,k+1)+gridVertexUVW.gridV(i+1,j+beta,k+1));
		  }
		  else
		  {
		      e0 = V[i][j+1][k];/*Se o fluxo está vindo de uma ghost cell ela só pode ser inflow */
		  }

		  if(ISNOTAIR_OUTFLOW(flag[i-1][j+alpha][k]))
		  {
                     c1 = U[i][j+alpha][k];
		  }
                 else 
		 {
		     if(j<S.gridp[1] || (alpha == -1))
		    {	
                     	c1 = .25*(gridVertexUVW.gridU(i,j+gama,k)+gridVertexUVW.gridU(i,j+beta,k) + 
			   gridVertexUVW.gridU(i,j+gama,k+1)+gridVertexUVW.gridU(i,j+beta,k+1));
		    }
		    else
		    {
			c1 = .5*(gridVertexUVW.gridU(i,j+1,k)+ gridVertexUVW.gridU(i,j+1,k+1));
		    }
		 }
			
                 if(ISNOTAIR_OUTFLOW(flag[i+1][j+alpha][k]))
		 {
                     d1 = U[i+1][j+alpha][k];
		 }
                 else 
		 {
		     if(j<S.gridp[1] || (alpha == -1))
		     {
                     	d1 =.25*(gridVertexUVW.gridU(i+1,j+gama,k)+gridVertexUVW.gridU(i+1,j+beta,k) + 
			     gridVertexUVW.gridU(i+1,j+gama,k+1)+gridVertexUVW.gridU(i+1,j+beta,k+1));
		     }
		     else
		    {
			d1 = .5*(gridVertexUVW.gridW(i+1,j+1,k)+ gridVertexUVW.gridW(i+1,j+1,k+1));
		    }
		 }
		  coef1 = c1+d1;
		
		  if(ISNOTAIR_OUTFLOW(flag[i][j+alpha][k-1]))
		  {
                     c2 = W[i][j+alpha][k];
		  }
                 else 
		 {
		     if(j<S.gridp[1] || (alpha == -1))
		    {	
                     	c2 = .25*(gridVertexUVW.gridW(i,j+gama,k)+gridVertexUVW.gridW(i,j+beta,k) + 
			   gridVertexUVW.gridW(i+1,j+gama,k)+gridVertexUVW.gridW(i+1,j+beta,k));
		    }
		    else
		    {
			c2 = .5*(gridVertexUVW.gridW(i,j+1,k)+ gridVertexUVW.gridW(i+1,j+1,k));
		    }
		 }
			
                 if(ISNOTAIR_OUTFLOW(flag[i][j+alpha][k+1]))
		 {
                     d2 = W[i][j+alpha][k+1];
		 }
                 else 
		 {
		     if(j<S.gridp[1] || (alpha == -1))
		     {
                     	d2 =.25*(gridVertexUVW.gridW(i,j+gama,k+1)+gridVertexUVW.gridW(i,j+beta,k+1) + 
			     gridVertexUVW.gridW(i+1,j+gama,k+1)+gridVertexUVW.gridW(i+1,j+beta,k+1));
		     }
		     else
		    {
			d2 = .5*(gridVertexUVW.gridW(i,j+1,k+1)+ gridVertexUVW.gridW(i+1,j+1,k+1));
		    }
		 }
		  coef2 = c2 +d2;

	      }
	      if((coef1)>= 0)
	      {
		 coef1 *=(-1.0/(DX[i-1]+DX[i]));
                 if(ISFLUID_INFLOW(flag[i-1][j][k]))
                 {
                    f1=e1=V[i-1][j+gama][k];
		 }
		 else
		 {
		    f1=V[i][j+gama][k];
		    e1 =.25*(gridVertexUVW.gridV(i-1,j+gama,k)+gridVertexUVW.gridV(i-1,j+gama,k+1) + 
			     gridVertexUVW.gridV(i,j+gama,k)+gridVertexUVW.gridV(i,j+gama,k+1));
		 }
		 if(ISFLUID_INFLOW(flag[i+1][j][k]))
		 {
		    g1=V[i+1][j+gama][k];
		 }
		 else
		 {
		    g1=V[i][j+gama][k];
		 }
	       }
	       else
	       {
		  coef1 *=(1.0/(DX[i+1]+DX[i]))
                  if(ISFLUID_INFLOW(flag[i+1][j][k]))
                  {
                     g1=e1=V[i+1][j+gama][k];
		  }
		  else
		  {	
		     if(i<S.gridp[0])
		     {
			 g1=V[i][j+gama][k];
			 e1 =.25*(gridVertexUVW.gridV(i+1,j+gama,k)+gridVertexUVW.gridV(i+1,j+gama,k+1) + 
			     gridVertexUVW.gridV(i+2,j+gama,k)+gridVertexUVW.gridV(i+2,j+gama,k));
		     }
		     else
		     {
			 e1 =.5*(gridVertexUVW.gridV(i+1,j+1,k)+gridVertexUVW.gridV(i+1,j+1,k+1));
		     }
		   }
		   if(ISFLUID_INFLOW(flag[i-1][j][k]))
		   {
		      f1=V[i-1][j+gama][k];
		   }
		   else
		   {
		      f1=V[i][j+gama][k];
		   }
	      }
	      if((coef2)>=0)
	      {
		   coef2 *=(-1.0/(DZ[k-1]+DZ[k]))
                   if(ISFLUID_INFLOW(flag[i][j][k-1]))
                   {
                       f2=e2=V[i][j+gama][k-1];
		   }
		   else
		   {
		        f2=V[i][j+gama][k];
			e2 =.25*(gridVertexUVW.gridV(i,j+gama,k-1)+gridVertexUVW.gridV(i+1,j+gama,k-1) + 
			     gridVertexUVW.gridV(i,j+gama,k)+gridVertexUVW.gridV(i+1,j+gama,k));
		   }
		   if(ISFLUID_INFLOW(flag[i][j][k+1]))
		   {
			g2=V[i][j+gama][k+1];
		   }
		   else
		   {
		        g2=V[i][j+gama][k];
		   }
	       }
	       else
	       {
		  coef2 *=(1.0/(DZ[k+1]+DZ[k]))
                  if(ISFLUID_INFLOW(flag[i][j][k+1]))
                  {
                       g2=e2=V[i][j+gama][k+1];
		  }
		  else
		  {	
		       g2=V[i][j+gama][k];
		       if(k<S.gridp[2])
		       {
			   e2 =.25*(gridVertexUVW.gridV(i,j+gama,k+1)+gridVertexUVW.gridV(i+1,j+gama,k+1) + 
			        gridVertexUVW.gridV(i,j+gama,k+2)+gridVertexUVW.gridV(i+1,j+gama,k+2));
		       }
		       else
		       {
			   e2 =.5*(gridVertexUVW.gridV(i,j+1,k+1)+gridVertexUVW.gridV(i+1,j+1,k+1));
		       }
		  }
		   if(ISFLUID_INFLOW(flag[i][j][k+1]))
		   {
			f2=V[i][j+gama][k-1];
		   }
		   else
		   {
		        f2=V[i][j+gama][k];
		   }
	       }
	       double derconv= coef0 *(e0-V[i][j+gama][k])+ coef1*(e1-V[i][j+gama][k]) + coef2*(e2-V[i][j+gama][k]);

               d2vdy2=DD(V[i][j][k],V[i][j+gama][k],V[i][j+1][k],1,j+gama);
               d2vdx2=DDS(f1,V[i][j+gama][k],g1,0,i);
               d2vdz2=DDS(f2,V[i][j+gama][k],g2,2,k);

               G[i][j+gama][k] = S.nu*(d2vdx2+d2vdy2+d2vdz2) - derconv + Gy; 

               double temp=fabs(-derconv*S.delt +  V[i][j+1][k]);
               double max_temp = 0;
               for(int idel=-1;idel<=1;idel++) 
               {
                  for(int jdel=-1;jdel<=1;jdel++)
                  {
                      for(int kdel=-1;kdel<=1;kdel++)
                      {
                          if((ISNOTAIR(flag[i+1+idel][j+gama+jdel][k+kdel])) &&
                             (fabs(V[i+1+idel][j+gama+jdel][k+kdel]) > max_temp))
                                max_temp = fabs(V[i+idel][j+gama+jdel][k+kdel]);
                       }
                  }
               }
               if(temp > max_temp)
               {
                   cout<<"************************************************************************** \n";
                   cout<<"**********i+1,j,k,temp,max_temp"<<i<<","<<j<<","<<k<<","<<temp<<","<<max_temp<<"\n";
               }
}